<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="fm" uri="http://www.springframework.org/tags/form"%>
<%@include file="/WEB-INF/jsp/common/head.jsp"%>
        <div class="right">
            <div class="location">
                <strong>你现在所在的位置是:</strong>
                <span>用户管理页面</span>
            </div>
			<div class="search">
                <form method="post" action="${pageContext.request.contextPath }/user/list.html">
                    <input name="method" value="query" class="input-text" type="hidden">
                    <tr>
                        <td>用户编码：</td>
                        <td><input type="text" name="queryUserCode"
                                   value="${ queryUserCode}"></td>
                        <td>用户名：</td>
                        <td><input type="text" name="queryUserName"
                                   value="${ queryUserName}"></td>
                    </tr>
                    <tr>
                        <td>用户角色</td>
                        <td><select name="queryUserRole">
                            <option value="">---请选择---</option>
                            <option value="1"
                                    <c:if test="${queryUserRole== '1' }">selected="selected"</c:if>>员工</option>
                            <option value="2"
                                    <c:if test="${queryUserRole== '2' }">selected="selected"</c:if>>会议室管理员</option>
                            <option value="3"
                                    <c:if test="${queryUserRole== '3' }">selected="selected"</c:if>>超级管理员</option>
                        </select>					</td>
                        <td>用户状态：</td>
                        <td><select name="queryUserStatus">
                            <option value="">---请选择---</option>
                            <option value="0"
                                    <c:if test="${queryUserStatus== false }">selected="selected"</c:if>>离职</option>
                            <option value="1"
                                    <c:if test="${queryUserStatus== true }">selected="selected"</c:if>>在职</option>
                        </select></td>
                    </tr>

                    <input type="hidden" name="pageIndex" value="1"/>
                    <input	value="查 询" type="submit" id="searchbutton">
                    <a href="${pageContext.request.contextPath}/user/add.html" >
                        添加用户</a>
                </form>
			</div>
			<!--请在此处添加table表格 -->
            <!--用户-->
            <table class="providerTable" cellpadding="0" cellspacing="0">
                <tr class="firstTr">
                    <th width="10%">用户编码</th>
                    <th width="20%">用户名称</th>
                    <th width="10%">用户角色</th>
                    <th width="30%">状态</th>
                    <th width="30%">操作</th>
                </tr>
                <c:forEach var="user" items="${userList }" varStatus="status">
                    <tr>
                        <td>
                            <span>${user.code }</span>
                        </td>
                        <td>
                            <span>${user.name }</span>
                        </td>
                        <td>
                            <c:if test="${user.role==1}">
                                <span>员工</span>
                            </c:if>
                            <c:if test="${user.role==2}">
                                <span>会议管理员</span>
                            </c:if>
                            <c:if test="${user.role==3}">
                                <span>超级管理员</span>
                            </c:if>
                        </td>
                        <td>
                            <c:if test="${user.status == true}">
                                <span>在职</span>
                            </c:if>
                            <c:if test="${user.status == false}">
                                <span>离职</span>
                            </c:if>
                        </td>
                        <td>
                            <span><a class="viewUser" href="javascript:;" userid=${user.id } username=${user.name }><img src="${pageContext.request.contextPath }/statics/images/read.png" alt="查看" title="查看"/></a></span>
                            <span><a class="modifyUser" href="javascript:;" userid=${user.id } username=${user.name }><img src="${pageContext.request.contextPath }/statics/images/xiugai.png" alt="修改" title="修改"/></a></span>
                            <span><a class="deleteUser" href="javascript:;" userid=${user.id } username=${user.name }><img src="${pageContext.request.contextPath }/statics/images/schu.png" alt="删除" title="删除"/></a></span>
                        </td>
                    </tr>
                </c:forEach>
            </table>

            <input type="hidden" id="totalPageCount" value="${totalPageCount}"/>
            <c:import url="/WEB-INF/jsp/common/rollpage.jsp">
                <c:param name="totalCount" value="${totalCount}"/>
                <c:param name="currentPageNo" value="${pageIndex}"/>
                <c:param name="totalPageCount" value="${totalPageCount}"/>
            </c:import>
        </div>
		</div>
    </section>

<!--点击删除按钮后弹出的页面-->
<div class="zhezhao"></div>
<div class="remove" id="removeUse">
    <div class="removerChid">
        <h2>提示</h2>
        <div class="removeMain">
            <p>你确定要删除该用户吗？</p>
            <a href="#" id="yes">确定</a>
            <a href="#" id="no">取消</a>
        </div>
    </div>
</div>

<%@include file="/WEB-INF/jsp/common/foot.jsp" %>
<!-- 请注意更新JS脚本路径 -->
<script type="text/javascript" 
	src="${pageContext.request.contextPath }/statics/js/userlist.js"></script>
